import React from 'react';
import {useLocation, useSearchParams} from "react-router-dom";
import {useQueryString} from "../hooks";

function NewsList(props) {
    // console.log(useLocation())
    // const {search} = useLocation();
    // function useQueryString(){
    //
    // }

    // 2
    const {id,type} = useQueryString();

    // 3
    const [search] = useSearchParams();
    return (
        <div>
            <h3>新闻列表界面</h3>
            <p>id:{id}|{search.get("id")}</p>
            <p>type:{type}|{search.get("type")}</p>
        </div>
    );
}

export default NewsList;